<?php
	require_once PATH_OBJECT.'dataObject.php';
	
class dataObject_profil extends dataObject
{
 	/** @desc    Identifiant de l'profil
     * @var     int
     */
    public $_IDENTIFIANT_PROFIL = 0;
    
    /**
     * @desc    code du profil
     * @var     varchar
     */
    public $_CODE_PROFIL = '';
    /**
     * @desc    libelle duprofil
     * @var     varchar
     */
    public $_LIBELLE_PROFIL = '';

    const _CODE_DIRIGEANT= 'DIRIGEANT';
    const _CODE_AGENT= 'VENDE';
    
    
	public function __construct( $iId=0 )
    {
       parent::__construct();

       if ( $iId != 0 )
       {
            $sQuery = "SELECT   *   /*+ dataObject_profil::__construct */  
                       FROM profil 
            		   WHERE Identifiant_profil =".$iId;
            
            $aRows =  self::$_oConnexion->query($sQuery);
			$aRow = $aRows[0];
            $this->_IDENTIFIANT_PROFIL  = $iId;
            $this->_CODE_PROFIL         = $aRow['Code_profil'];
            $this->_LIBELLE_PROFIL      = $aRow['Libelle_profil'];
          

       }
    }
    public function dataObject_profil( $iId=0 )
    {
    	__construct( $iId);
    }
    /**
     * récupere la table profil selon le(s) criter(s) précisés 
	 */
    function profil_select( $sCritere = null )
    {
        $aRow = false;
    	$sQuery = "SELECT   *    
                   FROM profil 
            	   WHERE 1 = 1
    				{$sCritere}";
    	
        $aRow =  self::$_oConnexion->query($sQuery);

        return $aRow;
    }
    
	public function profil_getList()
    {
        $aRow = false;
  
        $aRow =  $this->profil_select ();
        
        return $aRow;
    }
    
}
?>